# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.log import logger
from jobbole.dao.article_info_dao import ArticleInfoDao


class JobbolePipeline(object):

    def process_item(self, item, spider):
        # 将博文信息持久化到数据库
        ArticleInfoDao.save(item["id"], item["title"], item["group_1"], item["group_2"], item["group_3"],
                            item["group_4"], item["group_5"], item["content"], item["url"], item["publish_date"])
